<?php
require_once('functions/connectDB.php');
if($_POST[studentID]!=null||$_POST[groupID]!=null){
	$query = "UPDATE students SET idgroups=('$_POST[groupID]') WHERE studentID=('$_POST[studentID]')";
}
else {echo '<p>The id provided is null! Please check again!</p>';}
$results = mysql_query($query) or die(mysql_error());
if($results)
	{
		echo "<p>You are in the group $_POST[groupID] now !</p>";
	}
mysql_close($db);

?>